﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;
using Sinacor.Infra.Service.Security.Services;
using Sinacor.Servico.Bovespa.Ordens.Service.ServiceContract;


namespace Sinacor.Servico.Bovespa.Ordens.Service.ServiceImplementation
{
    [SinacorServiceBehavior]
    public class LoteOrdem :  ServiceContract.ILoteOrdem
    {
        #region ILoteOrdem Members
        public List<DataContract.Response.LoteOrdemResponse> ConsultarLoteVinculado(DataContract.Request.ConsultarLoteVinculadoRequest pRequest)
        {
            return Translator.TranslateLoteOrdem.ToResponse(new BusinessLogic.LoteOrdem().ConsultarLoteVinculado(ServiceImplementation.Translator.TranslateLoteOrdem.ConsultarLoteVinculadoToParameter(pRequest)));
        }

        public int CriarLoteOrdem(List<DataContract.Request.LoteOrdemRequest> request)
        {
            return new BusinessLogic.LoteOrdem().CriarLoteOrdem(ServiceImplementation.Translator.TranslateLoteOrdem.ToBusinessEntity(request));
        }

        public bool TrocarLoteOrdem(List<DataContract.Request.LoteOrdemRequest> request)
        {
            return new BusinessLogic.LoteOrdem().TrocarLoteOrdem(ServiceImplementation.Translator.TranslateLoteOrdem.ToBusinessEntity(request));
        }
        #endregion     
    }
}
